using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Entities;
using Bll;

public partial class EditOrder : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            OrderBll orderBll=new OrderBll();
            GVOrderView.Visible = false;
            lblTotal.Text = orderBll.GetTotalOrderByOrderDay();
        }
    }
    protected void GVOrder_SelectedIndexChanged(object sender, EventArgs e)
    {
        int orderID = int.Parse(GVOrder.SelectedDataKey.Value.ToString());        
        Response.Redirect("ViewAdminOrderDetail.aspx?id="+orderID+"");
    }
    protected void btnsearchOrder_Click(object sender, EventArgs e)
    {
        GVOrderView.Visible = true;
        OrderBll orderBll = new OrderBll();
        lblTotalSearchOrder.Text = orderBll.GetTotalOrderBetWeenDay(txtDayfrom.Text, txtDayto.Text);
    }
    protected void GVOrderView_SelectedIndexChanged(object sender, EventArgs e)
    {
        int orderID = int.Parse(GVOrderView.SelectedDataKey.Value.ToString());
        Response.Redirect("ViewAdminSearchOrderDetail.aspx?id=" + orderID + "");
    }
}
